<template>
    <view class="content">
        <!-- #ifdef MP-WEIXIN -->
        <top-nav :inner-title="title" is-show-back="true" is-fixed="false" :navH="navH" :n="n" is-white="bg-white" opacity="1"></top-nav>
        <!-- #endif -->
        
        <view class='edit'>
            <view class="bg">
                <textarea @input="inputEvent" placeholder-style="font-size: 30rpx;margin:30rpx 0 0 20rpx;" placeholder="请输入您的意见以便于我们提供更好的帮助"></textarea>
            </view>
        </view>
        <view class='footer'>
            <button @click="enterEvent()">确定</button>
        </view>
    </view>
</template>

<script>
    import uniFly from 'unifly';
	import request from '../../common/request.js';
	import $api_base from '../../api/api_base.js';
	import topNav from '@/template/topnav/index.vue';
	export default {
		components: { topNav },
		data() {
			return {
				navH: 0,
				n: 0,
                orderNo: '',
                value: '',
                title:'意见反馈'
			}
		},
		onLoad: function (options) {
            this.navH  = getApp().globalData.navHeight;
            this.n     = getApp().globalData.n;
		},
		methods:{
			inputEvent: function (e) {
                this.value = e.target.value;
            },
            enterEvent: function () {
                var self = this;
                if (self.value.trim() == '') return false;
                $api_base.post($api_base.feedback,{content: self.value}).then(function(e){
                    let data = e.data;
                    if (data.ok == 1) {
                        uni.showModal({
                            content: data.msg, showCancel: false,
                            success: function (res) {
                                if (res.confirm) {
                                    uni.navigateBack();
                                }
                            }
                        });
                    }
                });
            }
		}
	}
</script>
<style>
  page {
  background-color: #fff;
  }
</style>
<style lang="scss" scoped>
	@import '../../pagesBuy/buy/remark/index.scss';
</style>

